



// This code is a generated code by a tool
// designed and coded by Shohdi Mohamed Elsheemy ( shohdi@gmail.com )            

using System;
using System.Collections.Generic;
using System.Web;
using System.Data.Common;
using Shohdi.DataHandler;
using System.Data;




namespace DatabaseComponent
{
    
    public partial class HintsDB
    {
         string _Connection = "";


        public string Connection
        {
            get { return _Connection; }
            set { _Connection = value; }
        }


       
         string _Provider = "System.Data.SqlClient";

        
        public string Provider
        {
            get { return _Provider; }
            set { _Provider = value; }
        }



        public HintsDB()
        {
        }

        public HintsDB(string __Connection,params string [] __Provider)
        {

            if (__Provider.Length > 0)
                _Provider = __Provider[0];

            _Connection = __Connection;
            
        }




        public List<Hints> Select(ClassDataHandler con, string strTop, string strWhere, params DbParameter[] whereParams)
        {
            if (whereParams == null)
                whereParams = new DbParameter[0];

            List<Hints> lstRet = new List<Hints>();

            string strQuery = " select " + strTop  + " * from dbo.[Hints]  " ;

            if (strWhere != "")
            {
                strQuery = strQuery + "  " + strWhere;
            }

            DbDataReader dr = con.SelectDataReader(strQuery, CommandType.Text, whereParams);


            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    Hints obj = new Hints();
 if (dr["ID"] != DBNull.Value)
                    {
                        obj.ID = (System.Int64)dr["ID"];
                    }
                    else
                    {
                        obj.ID = -1;
                    } 
 if (dr["HintTitleAR"] != DBNull.Value)
                    {
                        obj.HintTitleAR = (System.String)dr["HintTitleAR"];
                    }
                    else
                    {
                        obj.HintTitleAR = "";
                    } 
 if (dr["HintTitleEN"] != DBNull.Value)
                    {
                        obj.HintTitleEN = (System.String)dr["HintTitleEN"];
                    }
                    else
                    {
                        obj.HintTitleEN = "";
                    } 
 if (dr["HintDetailsAR"] != DBNull.Value)
                    {
                        obj.HintDetailsAR = (System.String)dr["HintDetailsAR"];
                    }
                    else
                    {
                        obj.HintDetailsAR = "";
                    } 
 if (dr["HintDetailsEN"] != DBNull.Value)
                    {
                        obj.HintDetailsEN = (System.String)dr["HintDetailsEN"];
                    }
                    else
                    {
                        obj.HintDetailsEN = "";
                    } 
 if (dr["HintDate"] != DBNull.Value)
                    {
                        obj.HintDate = (System.DateTime)dr["HintDate"];
                    }
                    else
                    {
                        obj.HintDate = DateTime.Now;
                    } 
 if (dr["HintImage"] != DBNull.Value)
                    {
                        obj.HintImage = (System.String)dr["HintImage"];
                    }
                    else
                    {
                        obj.HintImage = "";
                    } 



                    lstRet.Add(obj);
                   

                }
            }

            dr.Close();


            return lstRet;
        }


        public List<Hints> Select(string strTop, string strWhere, params DbParameter[] whereParams)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);

            con.OpenConnection();

            List<Hints> lstRet = Select(con, strTop, strWhere, whereParams);

            con.CloseConnection();

            return lstRet;
        }

        



        public void Insert(ClassDataHandler con , Hints obj)
        {
            
            

                    DbParameter prmHintTitleAR = con.createParameter();
                    prmHintTitleAR.ParameterName = "@HintTitleAR";
                    prmHintTitleAR.DbType =DbType.String;
                    if (obj.HintTitleAR == null)
                    {
                        prmHintTitleAR.Value = DBNull.Value;
                    }
                    else
                    {
                        prmHintTitleAR.Value = obj.HintTitleAR;
                    }
                

                    


                    DbParameter prmHintTitleEN = con.createParameter();
                    prmHintTitleEN.ParameterName = "@HintTitleEN";
                    prmHintTitleEN.DbType =DbType.String;
                    if (obj.HintTitleEN == null)
                    {
                        prmHintTitleEN.Value = DBNull.Value;
                    }
                    else
                    {
                        prmHintTitleEN.Value = obj.HintTitleEN;
                    }
                

                    


                    DbParameter prmHintDetailsAR = con.createParameter();
                    prmHintDetailsAR.ParameterName = "@HintDetailsAR";
                    prmHintDetailsAR.DbType =DbType.String;
                    if (obj.HintDetailsAR == null)
                    {
                        prmHintDetailsAR.Value = DBNull.Value;
                    }
                    else
                    {
                        prmHintDetailsAR.Value = obj.HintDetailsAR;
                    }
                

                    


                    DbParameter prmHintDetailsEN = con.createParameter();
                    prmHintDetailsEN.ParameterName = "@HintDetailsEN";
                    prmHintDetailsEN.DbType =DbType.String;
                    if (obj.HintDetailsEN == null)
                    {
                        prmHintDetailsEN.Value = DBNull.Value;
                    }
                    else
                    {
                        prmHintDetailsEN.Value = obj.HintDetailsEN;
                    }
                

                    


                    DbParameter prmHintDate = con.createParameter();
                    prmHintDate.ParameterName = "@HintDate";
                    prmHintDate.DbType =DbType.DateTime;
                    if (obj.HintDate == null)
                    {
                        prmHintDate.Value = DBNull.Value;
                    }
                    else
                    {
                        prmHintDate.Value = obj.HintDate;
                    }
                

                    


                    DbParameter prmHintImage = con.createParameter();
                    prmHintImage.ParameterName = "@HintImage";
                    prmHintImage.DbType =DbType.String;
                    if (obj.HintImage == null)
                    {
                        prmHintImage.Value = DBNull.Value;
                    }
                    else
                    {
                        prmHintImage.Value = obj.HintImage;
                    }
                

                    


           



            string strQuery = " insert into dbo.[Hints] ([HintTitleAR],[HintTitleEN],[HintDetailsAR],[HintDetailsEN],[HintDate],[HintImage]) VALUES (@HintTitleAR,@HintTitleEN,@HintDetailsAR,@HintDetailsEN,@HintDate,@HintImage) ; select SCOPE_IDENTITY() ";
 object scope = con.ExecuteScalar(strQuery, CommandType.Text, prmHintTitleAR,prmHintTitleEN,prmHintDetailsAR,prmHintDetailsEN,prmHintDate,prmHintImage);


                    try
                    {
                        obj.ID = System.Int64.Parse(scope.ToString());
                    }
                    catch
                    {
                        obj.ID = -1;
                    }


                    


           

        }



        public void Insert(Hints obj)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
            con.OpenConnection();

            Insert(con,obj);


            con.CloseConnection();
        }




        public void Update(ClassDataHandler con, Hints obj)
        {
            
            

                    DbParameter prmID = con.createParameter();
                    prmID.ParameterName = "@ID";
                    prmID.DbType =DbType.Int64;
                    if (obj.ID == null)
                    {
                        prmID.Value = DBNull.Value;
                    }
                    else
                    {
                        prmID.Value = obj.ID;
                    }
                

                    


                    DbParameter prmHintTitleAR = con.createParameter();
                    prmHintTitleAR.ParameterName = "@HintTitleAR";
                    prmHintTitleAR.DbType =DbType.String;
                    if (obj.HintTitleAR == null)
                    {
                        prmHintTitleAR.Value = DBNull.Value;
                    }
                    else
                    {
                        prmHintTitleAR.Value = obj.HintTitleAR;
                    }
                

                    


                    DbParameter prmHintTitleEN = con.createParameter();
                    prmHintTitleEN.ParameterName = "@HintTitleEN";
                    prmHintTitleEN.DbType =DbType.String;
                    if (obj.HintTitleEN == null)
                    {
                        prmHintTitleEN.Value = DBNull.Value;
                    }
                    else
                    {
                        prmHintTitleEN.Value = obj.HintTitleEN;
                    }
                

                    


                    DbParameter prmHintDetailsAR = con.createParameter();
                    prmHintDetailsAR.ParameterName = "@HintDetailsAR";
                    prmHintDetailsAR.DbType =DbType.String;
                    if (obj.HintDetailsAR == null)
                    {
                        prmHintDetailsAR.Value = DBNull.Value;
                    }
                    else
                    {
                        prmHintDetailsAR.Value = obj.HintDetailsAR;
                    }
                

                    


                    DbParameter prmHintDetailsEN = con.createParameter();
                    prmHintDetailsEN.ParameterName = "@HintDetailsEN";
                    prmHintDetailsEN.DbType =DbType.String;
                    if (obj.HintDetailsEN == null)
                    {
                        prmHintDetailsEN.Value = DBNull.Value;
                    }
                    else
                    {
                        prmHintDetailsEN.Value = obj.HintDetailsEN;
                    }
                

                    


                    DbParameter prmHintDate = con.createParameter();
                    prmHintDate.ParameterName = "@HintDate";
                    prmHintDate.DbType =DbType.DateTime;
                    if (obj.HintDate == null)
                    {
                        prmHintDate.Value = DBNull.Value;
                    }
                    else
                    {
                        prmHintDate.Value = obj.HintDate;
                    }
                

                    


                    DbParameter prmHintImage = con.createParameter();
                    prmHintImage.ParameterName = "@HintImage";
                    prmHintImage.DbType =DbType.String;
                    if (obj.HintImage == null)
                    {
                        prmHintImage.Value = DBNull.Value;
                    }
                    else
                    {
                        prmHintImage.Value = obj.HintImage;
                    }
                

                    


           



            string strQuery = " update dbo.[Hints] set [HintTitleAR]=@HintTitleAR,[HintTitleEN]=@HintTitleEN,[HintDetailsAR]=@HintDetailsAR,[HintDetailsEN]=@HintDetailsEN,[HintDate]=@HintDate,[HintImage]=@HintImage where  [ID]=@ID  ";

            con.ExecuteNonQuery(strQuery, CommandType.Text,prmID,prmHintTitleAR,prmHintTitleEN,prmHintDetailsAR,prmHintDetailsEN,prmHintDate,prmHintImage);

            

        }


        public void Update(Hints obj)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
            con.OpenConnection();

            Update(con, obj);


            con.CloseConnection();
        }



        public void Delete(ClassDataHandler con, Hints obj)
        {

            

                    DbParameter prmID = con.createParameter();
                    prmID.ParameterName = "@ID";
                    prmID.DbType =DbType.Int64;
                    if (obj.ID == null)
                    {
                        prmID.Value = DBNull.Value;
                    }
                    else
                    {
                        prmID.Value = obj.ID;
                    }
                

                    


           



           



            string strQuery = " delete from dbo.[Hints]  where  [ID]=@ID  "; 
                        con.ExecuteNonQuery(strQuery, CommandType.Text,prmID );  

             



        }


        public void Delete( Hints obj)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);

            con.OpenConnection();

            Delete(con, obj);

            con.CloseConnection();
        }





                    public List<Hints> getHintsByID(ClassDataHandler con,System.Int64 ID)
                    {
                        List<Hints> lstRet = new List<Hints>();


                        DbParameter prmID = con.createParameter();
                        prmID.ParameterName = "@ID";
                        prmID.DbType = DbType.Int64;
                        if (ID == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmID.Value = ID;
                        }


                        lstRet = Select(con, "" , " where [ID]=@ID ", prmID);



                        return lstRet;

                    }


                    public List<Hints> getHintsByID(System.Int64 ID)
                    {
                        List<Hints> lstRet = new List<Hints>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHintsByID(con, ID);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<Hints> getHintsByHintTitleAR(ClassDataHandler con,System.String HintTitleAR)
                    {
                        List<Hints> lstRet = new List<Hints>();


                        DbParameter prmHintTitleAR = con.createParameter();
                        prmHintTitleAR.ParameterName = "@HintTitleAR";
                        prmHintTitleAR.DbType = DbType.String;
                        if (HintTitleAR == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmHintTitleAR.Value = HintTitleAR;
                        }


                        lstRet = Select(con, "" , " where [HintTitleAR]=@HintTitleAR ", prmHintTitleAR);



                        return lstRet;

                    }


                    public List<Hints> getHintsByHintTitleAR(System.String HintTitleAR)
                    {
                        List<Hints> lstRet = new List<Hints>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHintsByHintTitleAR(con, HintTitleAR);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<Hints> getHintsByHintTitleEN(ClassDataHandler con,System.String HintTitleEN)
                    {
                        List<Hints> lstRet = new List<Hints>();


                        DbParameter prmHintTitleEN = con.createParameter();
                        prmHintTitleEN.ParameterName = "@HintTitleEN";
                        prmHintTitleEN.DbType = DbType.String;
                        if (HintTitleEN == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmHintTitleEN.Value = HintTitleEN;
                        }


                        lstRet = Select(con, "" , " where [HintTitleEN]=@HintTitleEN ", prmHintTitleEN);



                        return lstRet;

                    }


                    public List<Hints> getHintsByHintTitleEN(System.String HintTitleEN)
                    {
                        List<Hints> lstRet = new List<Hints>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHintsByHintTitleEN(con, HintTitleEN);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<Hints> getHintsByHintDetailsAR(ClassDataHandler con,System.String HintDetailsAR)
                    {
                        List<Hints> lstRet = new List<Hints>();


                        DbParameter prmHintDetailsAR = con.createParameter();
                        prmHintDetailsAR.ParameterName = "@HintDetailsAR";
                        prmHintDetailsAR.DbType = DbType.String;
                        if (HintDetailsAR == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmHintDetailsAR.Value = HintDetailsAR;
                        }


                        lstRet = Select(con, "" , " where [HintDetailsAR]=@HintDetailsAR ", prmHintDetailsAR);



                        return lstRet;

                    }


                    public List<Hints> getHintsByHintDetailsAR(System.String HintDetailsAR)
                    {
                        List<Hints> lstRet = new List<Hints>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHintsByHintDetailsAR(con, HintDetailsAR);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<Hints> getHintsByHintDetailsEN(ClassDataHandler con,System.String HintDetailsEN)
                    {
                        List<Hints> lstRet = new List<Hints>();


                        DbParameter prmHintDetailsEN = con.createParameter();
                        prmHintDetailsEN.ParameterName = "@HintDetailsEN";
                        prmHintDetailsEN.DbType = DbType.String;
                        if (HintDetailsEN == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmHintDetailsEN.Value = HintDetailsEN;
                        }


                        lstRet = Select(con, "" , " where [HintDetailsEN]=@HintDetailsEN ", prmHintDetailsEN);



                        return lstRet;

                    }


                    public List<Hints> getHintsByHintDetailsEN(System.String HintDetailsEN)
                    {
                        List<Hints> lstRet = new List<Hints>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHintsByHintDetailsEN(con, HintDetailsEN);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<Hints> getHintsByHintDate(ClassDataHandler con,System.DateTime HintDate)
                    {
                        List<Hints> lstRet = new List<Hints>();


                        DbParameter prmHintDate = con.createParameter();
                        prmHintDate.ParameterName = "@HintDate";
                        prmHintDate.DbType = DbType.DateTime;
                        if (HintDate == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmHintDate.Value = HintDate;
                        }


                        lstRet = Select(con, "" , " where [HintDate]=@HintDate ", prmHintDate);



                        return lstRet;

                    }


                    public List<Hints> getHintsByHintDate(System.DateTime HintDate)
                    {
                        List<Hints> lstRet = new List<Hints>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHintsByHintDate(con, HintDate);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<Hints> getHintsByHintImage(ClassDataHandler con,System.String HintImage)
                    {
                        List<Hints> lstRet = new List<Hints>();


                        DbParameter prmHintImage = con.createParameter();
                        prmHintImage.ParameterName = "@HintImage";
                        prmHintImage.DbType = DbType.String;
                        if (HintImage == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmHintImage.Value = HintImage;
                        }


                        lstRet = Select(con, "" , " where [HintImage]=@HintImage ", prmHintImage);



                        return lstRet;

                    }


                    public List<Hints> getHintsByHintImage(System.String HintImage)
                    {
                        List<Hints> lstRet = new List<Hints>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getHintsByHintImage(con, HintImage);

                        con.CloseConnection();

                        return lstRet;

                    }



                

            
public List<Hints> Search(ClassDataHandler con, Hints obj)
        {
            string strWhere = "";
            List<DbParameter> lstParameters = new List<DbParameter>();

            
                    if (obj.ID != -1)
                    {
                        DbParameter prmID = con.createParameter();
                        prmID.ParameterName = "@ID";
                        prmID.DbType =DbType.Int64;
                        if (obj.ID == null)
                        {
                            prmID.Value = DBNull.Value;
                        }
                        else
                        {
                            prmID.Value = obj.ID;
                        }
                        strWhere += " [ID]=@ID AND ";
                        lstParameters.Add(prmID);
                     }



                    

                    if (obj.HintTitleAR != "")
                    {
                        DbParameter prmHintTitleAR = con.createParameter();
                        prmHintTitleAR.ParameterName = "@HintTitleAR";
                        prmHintTitleAR.DbType =DbType.String;
                        if (obj.HintTitleAR == null)
                        {
                            prmHintTitleAR.Value = DBNull.Value;
                        }
                        else
                        {
                            prmHintTitleAR.Value = obj.HintTitleAR;
                        }
                        strWhere += " [HintTitleAR]=@HintTitleAR AND ";
                        lstParameters.Add(prmHintTitleAR);
                     }



                    

                    if (obj.HintTitleEN != "")
                    {
                        DbParameter prmHintTitleEN = con.createParameter();
                        prmHintTitleEN.ParameterName = "@HintTitleEN";
                        prmHintTitleEN.DbType =DbType.String;
                        if (obj.HintTitleEN == null)
                        {
                            prmHintTitleEN.Value = DBNull.Value;
                        }
                        else
                        {
                            prmHintTitleEN.Value = obj.HintTitleEN;
                        }
                        strWhere += " [HintTitleEN]=@HintTitleEN AND ";
                        lstParameters.Add(prmHintTitleEN);
                     }



                    

                    if (obj.HintDetailsAR != "")
                    {
                        DbParameter prmHintDetailsAR = con.createParameter();
                        prmHintDetailsAR.ParameterName = "@HintDetailsAR";
                        prmHintDetailsAR.DbType =DbType.String;
                        if (obj.HintDetailsAR == null)
                        {
                            prmHintDetailsAR.Value = DBNull.Value;
                        }
                        else
                        {
                            prmHintDetailsAR.Value = obj.HintDetailsAR;
                        }
                        strWhere += " [HintDetailsAR]=@HintDetailsAR AND ";
                        lstParameters.Add(prmHintDetailsAR);
                     }



                    

                    if (obj.HintDetailsEN != "")
                    {
                        DbParameter prmHintDetailsEN = con.createParameter();
                        prmHintDetailsEN.ParameterName = "@HintDetailsEN";
                        prmHintDetailsEN.DbType =DbType.String;
                        if (obj.HintDetailsEN == null)
                        {
                            prmHintDetailsEN.Value = DBNull.Value;
                        }
                        else
                        {
                            prmHintDetailsEN.Value = obj.HintDetailsEN;
                        }
                        strWhere += " [HintDetailsEN]=@HintDetailsEN AND ";
                        lstParameters.Add(prmHintDetailsEN);
                     }



                    

                    if (obj.HintDate != DateTime.Now)
                    {
                        DbParameter prmHintDate = con.createParameter();
                        prmHintDate.ParameterName = "@HintDate";
                        prmHintDate.DbType =DbType.DateTime;
                        if (obj.HintDate == null)
                        {
                            prmHintDate.Value = DBNull.Value;
                        }
                        else
                        {
                            prmHintDate.Value = obj.HintDate;
                        }
                        strWhere += " [HintDate]=@HintDate AND ";
                        lstParameters.Add(prmHintDate);
                     }



                    

                    if (obj.HintImage != "")
                    {
                        DbParameter prmHintImage = con.createParameter();
                        prmHintImage.ParameterName = "@HintImage";
                        prmHintImage.DbType =DbType.String;
                        if (obj.HintImage == null)
                        {
                            prmHintImage.Value = DBNull.Value;
                        }
                        else
                        {
                            prmHintImage.Value = obj.HintImage;
                        }
                        strWhere += " [HintImage]=@HintImage AND ";
                        lstParameters.Add(prmHintImage);
                     }



                    


            if (strWhere != "")
                        strWhere = " where " + strWhere.Substring(0, strWhere.LastIndexOf("AND"));

                    

            

            List<Hints> lstRet = Select(con, "", strWhere, lstParameters.ToArray());

            return lstRet;
        }


        public List<Hints> Search(Hints obj)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);

            con.OpenConnection();

            List<Hints> lstRet = Search(con,obj);

            con.CloseConnection();

            return lstRet;
        }


                

            
public List<Hints> SearchOrLike(ClassDataHandler con, Hints obj)
        {
            string strWhere = "";
            List<DbParameter> lstParameters = new List<DbParameter>();

            
                    if (obj.ID != -1)
                    {
                        DbParameter prmID = con.createParameter();
                        prmID.ParameterName = "@ID";
                        prmID.DbType =DbType.Int64;
                        if (obj.ID == null)
                        {
                            prmID.Value = DBNull.Value;
                        }
                        else
                        {
                            prmID.Value = obj.ID;
                        }
                        strWhere += " [ID]=@ID OR ";
                        lstParameters.Add(prmID);
                     }



                    

                    if (obj.HintTitleAR != "")
                    {
                        DbParameter prmHintTitleAR = con.createParameter();
                        prmHintTitleAR.ParameterName = "@HintTitleAR";
                        prmHintTitleAR.DbType =DbType.String;
                        if (obj.HintTitleAR == null)
                        {
                            prmHintTitleAR.Value = DBNull.Value;
                        }
                        else
                        {
                            prmHintTitleAR.Value = obj.HintTitleAR;
                        }
                        strWhere += " [HintTitleAR] LIKE @HintTitleAR OR ";
                        lstParameters.Add(prmHintTitleAR);
                     }



                    

                    if (obj.HintTitleEN != "")
                    {
                        DbParameter prmHintTitleEN = con.createParameter();
                        prmHintTitleEN.ParameterName = "@HintTitleEN";
                        prmHintTitleEN.DbType =DbType.String;
                        if (obj.HintTitleEN == null)
                        {
                            prmHintTitleEN.Value = DBNull.Value;
                        }
                        else
                        {
                            prmHintTitleEN.Value = obj.HintTitleEN;
                        }
                        strWhere += " [HintTitleEN] LIKE @HintTitleEN OR ";
                        lstParameters.Add(prmHintTitleEN);
                     }



                    

                    if (obj.HintDetailsAR != "")
                    {
                        DbParameter prmHintDetailsAR = con.createParameter();
                        prmHintDetailsAR.ParameterName = "@HintDetailsAR";
                        prmHintDetailsAR.DbType =DbType.String;
                        if (obj.HintDetailsAR == null)
                        {
                            prmHintDetailsAR.Value = DBNull.Value;
                        }
                        else
                        {
                            prmHintDetailsAR.Value = obj.HintDetailsAR;
                        }
                        strWhere += " [HintDetailsAR] LIKE @HintDetailsAR OR ";
                        lstParameters.Add(prmHintDetailsAR);
                     }



                    

                    if (obj.HintDetailsEN != "")
                    {
                        DbParameter prmHintDetailsEN = con.createParameter();
                        prmHintDetailsEN.ParameterName = "@HintDetailsEN";
                        prmHintDetailsEN.DbType =DbType.String;
                        if (obj.HintDetailsEN == null)
                        {
                            prmHintDetailsEN.Value = DBNull.Value;
                        }
                        else
                        {
                            prmHintDetailsEN.Value = obj.HintDetailsEN;
                        }
                        strWhere += " [HintDetailsEN] LIKE @HintDetailsEN OR ";
                        lstParameters.Add(prmHintDetailsEN);
                     }



                    

                    if (obj.HintDate != DateTime.Now)
                    {
                        DbParameter prmHintDate = con.createParameter();
                        prmHintDate.ParameterName = "@HintDate";
                        prmHintDate.DbType =DbType.DateTime;
                        if (obj.HintDate == null)
                        {
                            prmHintDate.Value = DBNull.Value;
                        }
                        else
                        {
                            prmHintDate.Value = obj.HintDate;
                        }
                        strWhere += " [HintDate]=@HintDate OR ";
                        lstParameters.Add(prmHintDate);
                     }



                    

                    if (obj.HintImage != "")
                    {
                        DbParameter prmHintImage = con.createParameter();
                        prmHintImage.ParameterName = "@HintImage";
                        prmHintImage.DbType =DbType.String;
                        if (obj.HintImage == null)
                        {
                            prmHintImage.Value = DBNull.Value;
                        }
                        else
                        {
                            prmHintImage.Value = obj.HintImage;
                        }
                        strWhere += " [HintImage] LIKE @HintImage OR ";
                        lstParameters.Add(prmHintImage);
                     }



                    


            if (strWhere != "")
                        strWhere = " where " + strWhere.Substring(0, strWhere.LastIndexOf("OR"));

                    

            

            List<Hints> lstRet = Select(con, "", strWhere, lstParameters.ToArray());

            return lstRet;
        }


        public List<Hints> SearchOrLike(Hints obj)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);

            con.OpenConnection();

            List<Hints> lstRet = SearchOrLike(con,obj);

            con.CloseConnection();

            return lstRet;
        }


                
        


       
        



    }
}











            